Skip to content

feat: blocks#3

Merged
FatahChan merged 4 commits into
mainfrom
feat/blocks
May 11, 2025
Merged

feat: blocks#3
FatahChan merged 4 commits into
mainfrom
feat/blocks

Conversation

@FatahChan
Copy link
Copy Markdown
Owner

@FatahChan FatahChan commented May 11, 2025

Summary by CodeRabbit

  • New Features

    • Introduced new form components for Login, Sign Up, Basic Info, and Shipping Info, all with validation and registry metadata.
    • Added a blocks registry and a new route to browse and filter available form blocks.
    • Added installation instructions and improved navigation on the homepage.
    • Added new UI components: Checkbox, Popover, and Radio Group.
    • Added a code snippet component with copy-to-clipboard functionality.
  • Improvements

    • Enhanced form validation and metadata handling using schemas.
    • Updated preview and block browsing routes for a simplified experience.
    • Improved block preview loading and filtering UI.
  • Chores

    • Updated dependencies and scripts for better development workflow.
    • Improved pre-commit hook configuration and code formatting settings.
  • Style

    • Ensured pointer cursor on interactive button elements for better usability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a comprehensive registry system for form-related React components, refactors block management to use a metadata-driven approach, and adds several new UI primitives. It restructures routing for preview and block listing, enhances code organization with new schemas and scripts, and improves the developer and user experience with new scripts, UI components, and styling conventions.

Changes

File(s) / Group Change Summary
.vscode/settings.json Updated VSCode save actions to enable explicit Biome fixes on save.
lefthook.yml Changed pre-commit hook commands and patterns; switched to pnpm commands and updated registry build/staging logic.
package.json Added registry:watch script, new dependencies (@radix-ui/react-checkbox, @radix-ui/react-popover), and reorganized devDependencies.
public/r/basic-info.json
public/r/login-form.json
public/r/login.json
public/r/shipping-info.json
public/r/sign-up.json
public/r/tanstack-form.json
Added/updated registry block metadata and dependencies for several form components; removed dependencies from tanstack-form.json.
registry.json Overhauled registry with detailed entries for multiple blocks, including embedded source code and metadata.
src/components/block-preview.tsx Refactored to use RegistryItem type, improved content extraction, lazy loading, and preview toggling.
src/components/code-snippet.tsx Added new CodeSnippet component for displaying and copying code.
src/components/ui/checkbox.tsx
src/components/ui/popover.tsx
src/components/ui/radio-group.tsx
Introduced new UI primitives: Checkbox, Popover, and RadioGroup components, each wrapping Radix UI primitives.
src/components/ui/textarea.tsx Reformatted imports and class names; no functional changes.
src/data/blocks.ts Removed old hardcoded block data file.
src/hooks/use-iframe-height.ts Adjusted height calculation logic for iframe measurement.
src/registry/new-york/blocks/basic-info.json
src/registry/new-york/blocks/login.json
src/registry/new-york/blocks/shipping-info.json
src/registry/new-york/blocks/sign-up.json
Added new JSON metadata files for each block, specifying categories, dependencies, and descriptions.
src/registry/new-york/blocks/basic-info.tsx Added "use client" directive and set displayName for BasicInfoForm.
src/registry/new-york/blocks/login.tsx
src/registry/new-york/blocks/shipping-info.tsx
src/registry/new-york/blocks/sign-up.tsx
Added new React form components for login, shipping info, and sign-up, each using TanStack Form and Zod validation.
src/routeTree.gen.ts Replaced /preview/$category/$slug route with /preview/$name and added /blocks/ route; updated all related route type declarations.
src/routes/__root.tsx Added bg-background class to <body>.
src/routes/blocks/index.tsx Added new /blocks/ route to list and filter block registry items with category filters and previews.
src/routes/index.tsx Now loads block data from registry, adds installation instructions, and updates layout/navigation.
src/routes/preview/$name.tsx Refactored preview route to use a single name param and dynamic import; updated loader and component logic.
src/schemas/block-meta-data.ts Added new Zod schema and type for block metadata validation.
src/schemas/registry-item.ts Added new Zod schema and type for registry item validation.
src/scripts/blocks.ts Added script to process block files and metadata, update registry, and watch for changes.
src/styles.css Ensured pointer cursor for enabled buttons and elements with role="button".

Sequence Diagram(s)

Block Registry Update and Consumption

sequenceDiagram
    participant Dev as Developer
    participant Script as blocks.ts Script
    participant FS as File System
    participant Registry as registry.json
    participant App as Application

    Dev->>Script: Runs or modifies block files
    Script->>FS: Reads .tsx and .json files in blocks directory
    Script->>Script: Validates metadata with schema
    Script->>Registry: Updates registry.json with new/updated items
    App->>Registry: Loads registry.json at runtime
    App->>App: Filters, validates, and displays block previews/routes
Loading

Block Preview Rendering Flow

sequenceDiagram
    participant User as User
    participant App as App UI
    participant Registry as registry.json

    User->>App: Navigates to /blocks or /preview/$name
    App->>Registry: Loads registry items
    App->>App: Filters and selects block by name
    App->>App: Renders BlockPreview with code/preview
Loading

Poem

🐇
New blocks have hopped into the registry field,
With schemas and scripts, their structure revealed.
Forms for login, shipping, and sign-up too,
UI components shiny and new!
Now routes are simpler, the code is neat—
A bunny’s work is never complete!
🥕✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9d4736 and ad48747.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (35)
  • .vscode/settings.json (1 hunks)
  • lefthook.yml (1 hunks)
  • package.json (2 hunks)
  • public/r/basic-info.json (1 hunks)
  • public/r/login-form.json (1 hunks)
  • public/r/login.json (1 hunks)
  • public/r/shipping-info.json (1 hunks)
  • public/r/sign-up.json (1 hunks)
  • public/r/tanstack-form.json (0 hunks)
  • registry.json (1 hunks)
  • src/components/block-preview.tsx (10 hunks)
  • src/components/code-snippet.tsx (1 hunks)
  • src/components/ui/checkbox.tsx (1 hunks)
  • src/components/ui/popover.tsx (1 hunks)
  • src/components/ui/radio-group.tsx (1 hunks)
  • src/components/ui/textarea.tsx (1 hunks)
  • src/data/blocks.ts (0 hunks)
  • src/hooks/use-iframe-height.ts (1 hunks)
  • src/registry/new-york/blocks/basic-info.json (1 hunks)
  • src/registry/new-york/blocks/basic-info.tsx (2 hunks)
  • src/registry/new-york/blocks/login.json (1 hunks)
  • src/registry/new-york/blocks/login.tsx (1 hunks)
  • src/registry/new-york/blocks/shipping-info.json (1 hunks)
  • src/registry/new-york/blocks/shipping-info.tsx (1 hunks)
  • src/registry/new-york/blocks/sign-up.json (1 hunks)
  • src/registry/new-york/blocks/sign-up.tsx (1 hunks)
  • src/routeTree.gen.ts (5 hunks)
  • src/routes/__root.tsx (1 hunks)
  • src/routes/blocks/index.tsx (1 hunks)
  • src/routes/index.tsx (3 hunks)
  • src/routes/preview/$name.tsx (1 hunks)
  • src/schemas/block-meta-data.ts (1 hunks)
  • src/schemas/registry-item.ts (1 hunks)
  • src/scripts/blocks.ts (1 hunks)
  • src/styles.css (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 11, 2025

Deploying shadcn-tanstack-form with  Cloudflare Pages  Cloudflare Pages

Latest commit: ad48747
Status: ✅  Deploy successful!
Preview URL: https://4fe743b7.shadcn-tanstack-form.pages.dev
Branch Preview URL: https://feat-blocks.shadcn-tanstack-form.pages.dev

View logs

@netlify
Copy link
Copy Markdown

netlify Bot commented May 11, 2025

Deploy Preview for shadcn-tanstack-form ready!

Name Link
🔨 Latest commit ad48747
🔍 Latest deploy log https://app.netlify.com/sites/shadcn-tanstack-form/deploys/6820d78668a4400007ab1ef6
😎 Deploy Preview https://deploy-preview-3--shadcn-tanstack-form.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@FatahChan FatahChan force-pushed the feat/blocks branch 3 times, most recently from 1416dec to 0908187 Compare May 11, 2025 12:33
@FatahChan FatahChan marked this pull request as ready for review May 11, 2025 17:00
@FatahChan FatahChan changed the title Feat/blocks feat: blocks May 11, 2025
@FatahChan FatahChan merged commit d55ce5c into main May 11, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant